package es.udc.emarketapp.emarket.model.orderDetails.dao;

import es.udc.emarketapp.emarket.model.orderDetails.vo.OrderDetailsVO;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import java.sql.Connection;
import java.util.Calendar;
import java.util.List;

public interface SQLOrderDetailsDAO {

    public OrderDetailsVO create(Connection connection, OrderDetailsVO lineOrederVO)
            throws InternalErrorException;

    public boolean exists(Connection connection, Long nPedido, Long nCompra)
            throws InternalErrorException;

    public OrderDetailsVO findById(Connection connection, Long nPedido)
            throws InstanceNotFoundException, InternalErrorException;

    public List<OrderDetailsVO> findByPurchase(Connection connection, Long nCompra,
            int startIndex, int count) throws InternalErrorException;

    public List<OrderDetailsVO> findBySeller(Connection connection, String idSeller,
            int startIndex, int count) throws InternalErrorException;

    public List<OrderDetailsVO> findByPaidPendent(Connection connection,
            int startIndex, int count) throws InternalErrorException;

    public List<OrderDetailsVO> findByPaidPendentAndSeller(Connection connection,
            String idVendedor, int startIndex, int count)
            throws InternalErrorException;

    public List<OrderDetailsVO> findByShippingPendent(Connection connection,
            int startIndex, int count) throws InternalErrorException;

    public List<OrderDetailsVO> findByShippingPendentAndSeller(Connection connection,
            String idVendedor, int startIndex, int count)
            throws InternalErrorException;

    public List<OrderDetailsVO> findAll(Connection connection,
            int startIndex, int count) throws InternalErrorException;

     public List<OrderDetailsVO> findByDate(Connection connection,
         Calendar startDate, Calendar endDate, int startIndex,
         int count) throws InternalErrorException;

    /*
      public List<OrderDetailsVO> findBySellerAndDate(Connection connection,
        Long idSeller, Calendar startDate, Calendar endDate,
        int startIndex, int count) throws InternalErrorException;

     *
     */
    public void updateShippingDate(Connection connection, Long nOrder)
            throws InstanceNotFoundException, InternalErrorException;

    public void updatePaymentDate(Connection connection, Long nOrder)
            throws InstanceNotFoundException, InternalErrorException;

    public void update(Connection connection, OrderDetailsVO orderVO)
            throws InstanceNotFoundException, InternalErrorException;

    public void remove(Connection connection, Long nPedido, Long nCompra)
            throws InstanceNotFoundException, InternalErrorException;
}
